package com.tbit.uqbike.service.business;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tbit.maintain.dto.StockMachineDTO;
import com.tbit.uqbike.object.pojo.RecoveryLog;
import com.tbit.uqbike.object.pojo.StockMachine;
import com.tbit.uqbike.object.pojo.dto.RecoveryDownloadDTO;
import com.tbit.uqbike.object.pojo.vo.StockMachineVO;
import com.tbit.uqbike.object.value.LoginInfo;
import com.tbit.common.entity.view.PageResult;
import com.tbit.common.entity.view.Result;

import java.util.List;
import java.util.Map;

/**
 * @author yee_
 * @version 1.0
 * @date 2023/2/20 13:35
 */
public interface StockMachineService extends IService<StockMachine> {
    /**
     * 分页查询出入库记录
     *
     * @param accountId 。
     * @param userCode  。
     * @param page      。
     * @return
     */
    Result<PageResult<StockMachineVO>> pageList(Integer accountId, String userCode, Page<StockMachine> page);

    /**
     * 查询车辆库存率
     *
     * @param accountId 区域id
     * @param userCode  车辆user
     * @return 。
     */
    Result<Double> selectMachineStockRate(Integer accountId, String userCode);

    /**
     * 车辆回收记录查询
     *
     * @param accountId .
     * @param startTime 。
     * @param endTime   .
     * @param state     .
     * @param of        。
     * @return 。
     */
    Result<PageResult<RecoveryLog>> recoveryList(String userCode,Integer dateState,List<Integer> accountId, String startTime, String endTime, Integer state, Page<RecoveryLog> of);

    List<StockMachineVO> selectByWarehouseIdS(List<Integer> warehouseId, Integer accountId);

    List<Integer> getNoWarehouseId(Integer adAccountId);

    List<StockMachineVO> selectByWarehouseId(Integer warehouseId);

    Map<String, Object> delBatch(List<String> userCodes, Integer accountId, LoginInfo loginInfo);

    void updateBatch(List<String> userCodes, String warehouseName, String warehouseId, LoginInfo loginInfo);

    String recoveryListDownloadCsv(RecoveryDownloadDTO downloadDTO);

    List<StockMachineVO> selectByWarehouseIdS(List<Integer> warehouseId,String userCode, Integer accountId);

    Result<Object> recoveryListDownload(RecoveryDownloadDTO downloadDTO);

    Map<String,Object> addBatch(StockMachineDTO stockMachineDTO,LoginInfo loginInfo);
}
